<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var arr = new Set([1, 2, 23, 42, 22, 2, 2, 21])
        console.log(arr.size);
        var arr1 = Array.from(arr)
        console.log(arr1);
    </script>
</body>

</html>